package com.huirui.server.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum ProductStatus {
    SELLING(0, "出售中"),
    OFF_SHELF(1, "已下架"),
    SOLD_OUT(2, "已售罄");


    // 用于存储数据库中的值
    @EnumValue
    @JsonValue
    private final Integer code;
    private final String status;

    ProductStatus(int code, String status) {
        this.code = code;
        this.status = status;
    }
}
